package com.wj.facade.modenPostOffice;

import com.wj.facade.impl.LetterProcessImpl;

/**
 * @author WangJin
 * @version 1.0
 * @date 2022/2/18 11:22
 */
public class ModenPostOffice {
    private LetterProcessImpl letterProcess = new LetterProcessImpl();

    //写信，封装，投递，一体化了
    public void sendLetter(String context,String address){
        //写信
        letterProcess.writeContext(context);
        //在信封上填写必要的信息
        letterProcess.fillEnvelope(address);
        //校验信函
        letterPolice(context,address);
        //把信放到信封中，并封好
        letterProcess.letterInotoEnvelope();
        //塞到邮箱中，邮递
        letterProcess.sendLetter();
    }

    public void letterPolice(String context,String address){
        System.out.println("检查写信内容是否有误！");
        System.out.println("检查写信地址是否有误！");
    }
}
